import http from "./request";
// home/advertise/list
// 分页查询广告
export const getAdvertiseList = (params: any): PRES<IRuesModel> => {
  return http.get("home/advertise/list", { params });
};

// 批量删除
// home/advertise/delete
// 批量删除推荐
export const homeAdvertiseDel = (ids: number[]): PRES<IReqSort> => {
  return http.post(`home/advertise/delete?ids=${ids}`);
};

// 添加
// home/advertise/create
export const homeAdvertiseCreate = (params: any): PRES<any> => {
  console.log("添加", params);
  return http.post(`home/advertise/create`, params);
};

//
// 获取单个广告详情
export const getHomeAdvertise = (id: any): PRES<any> => {
  return http.get(`home/advertise/${id}`);
};

// home/advertise/update/{id}
// 修改广告
export const postAdvertiseUpdateId = (id: any, params: any): PRES<any> => {
  return http.post(`home/advertise/update/${id}`, params);
};

// home/advertise/update/status/{id}
// 修改上下线状态
export const advUpdateStatus = (id: number, status: number): PRES<IReqSort> => {
  return http.post(`home/advertise/update/status/${id}?status=${status}`);
};
